home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / lang / c++-part1 / 1737 < prev    next >
Encoding:
Internet Message Format  |  1996-08-06  |  1.3 KB

  1. Path: gatekeeper.liffe.com!usenet
  2. From: jonathan.burton@liffe.com (Jonathan Burton)
  3. Newsgroups: comp.lang.c++
  4. Subject: Re: Window sizes with VC++ and MFC
  5. Date: Fri, 12 Jan 1996 16:45:01 +0000 (GMT)
  6. Organization: London International Financial Futures Exchange
  7. Message-ID: <4d63p0$8u4@gatekeeper.liffe.com>
  8. References: <nntpuserDL2oLp.BAC@netcom.com>
  9. NNTP-Posting-Host: rrt1.liffe.com
  10. X-Newsreader: Forte Free Agent v0.38
  11.  
  12. greg@netlanta.com (Greg Colin) wrote:
  13.  
  14. >I am creating code with AppWizard for an SDI application and want the window to
  15. >be a fized size, and without WS_THICKFRAME. I have fried overriding
  16. >CMainFrame::Create to use a RECT structure that I have set to the values I want,
  17. >but this does not work. 
  18.  
  19. >After a couple of hours looking through the online documentation (curses to
  20. >Micro$oft for not providing printed manuals with the software), I am posting
  21. >here in the hope that someone will take pity on a clueless newbie.
  22.  
  23. >Thanks a lot
  24. >Greg
  25.  
  26. Try something like this:-
  27.  
  28.         // in OnCreate
  29.     SetWindowPos( NULL, 0, 0, 640, 480, SWP_NOACTIVATE );
  30.     CenterWindow();
  31.  
  32.         // PreCreateWindow
  33.  
  34. BOOL CMainFrame::PreCreateWindow(CREATESTRUCT& cs) 
  35. {
  36.     cs.style &= ~(FWS_ADDTOTITLE);
  37.     cs.style &= ~(WS_THICKFRAME);
  38.     cs.style |= WS_BORDER;
  39.  
  40.     return CFrameWnd::PreCreateWindow(cs);
  41. }
  42.  
  43.  
  44. Jonathan Burton (jonathan.burton@liffe.com)
  45.  
  46.